﻿using System;

namespace EHSubmit.Model
{
    /// <summary>
    ///   Message对象的命名空间
    /// </summary>  
    public class Message
    {
        private int _id;                                 //Messege的标识属性
        private string _title;                           //标题
        private string _content;                         //消息内容
        private string _senderid;                        //发送者ID
        private string _receiverid;                      //接收者ID
        private string _sendername;                      //发送人姓名
        private string _receivername;                    //接收者姓名
        private DateTime _sendtime;                      //发送时间
        private DateTime _recvtime;                      //接收时间
        private bool _issviewed;                         //发送者是否已读
        private bool _isrviewed;                         //接收者是否已读
        private int _issdeleted;                         //是否被发送者删除
        private int _isrdeleted;                         //是否被接收者删除

        public Message()
        {
            this.Init();
        }


        /// <summary>
        /// 消息初始化
        /// </summary>
        /// <returns>初始化后返回真</returns>
        public bool Init()
        {
            this._id = 0;
            this._title = string.Empty;
            this._content = string.Empty;
            this._senderid = string.Empty;
            this._receiverid = string.Empty;
            this._sendername = string.Empty;
            this._receivername = string.Empty;
            this._sendtime = DateTime.Now;
            this._recvtime = DateTime.Now;
            this._issviewed = false;
            this._isrviewed = false;
            this._issdeleted = 0;
            this._isrdeleted = 0;
            return true;
        }


        public Message(int _id, string _title, string _content, string _senderid, string _receiverid, string _sendername, string _receivername, DateTime _sendtime, DateTime _recvtime, bool _issviewed, bool _isrviewed, int _issdeleted, int _isrdeleted)
        {
            this._id = _id;
            this._title = _title;
            this._content = _content;
            this._senderid = _senderid;
            this._receiverid = _receiverid;
            this._sendername = _sendername;
            this._receivername = _receivername;
            this._sendtime = _sendtime;
            this._recvtime = _recvtime;
            this._issviewed = _issviewed;
            this._isrviewed = _isrviewed;
            this._issdeleted = _issdeleted;
            this._isrdeleted = _isrdeleted;
        }

        public int ID
        {
            get { return _id; }
            set { _id = value; }
        }

        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        public string Content
        {
            get { return _content; }
            set { _content = value; }
        }

        public string SenderID
        {
            get { return _senderid; }
            set { _senderid = value; }
        }

        public string ReceiverID
        {
            get { return _receiverid; }
            set { _receiverid = value; }
        }

        /// <summary>
        /// 发件人姓名
        /// </summary>
        public string SenderName
        {
            get { return _sendername; }
            set { _sendername = value; }
        }
        /// <summary>
        /// 收件人姓名
        /// </summary>
        public string ReceiverName
        {
            get { return _receivername; }
            set { _receivername = value; }
        }
        public DateTime SendTime
        {
            get { return _sendtime; }
            set { _sendtime = value; }
        }

        public DateTime RecvTime
        {
            get { return _recvtime; }
            set { _recvtime = value; }
        }

        /// <summary>
        /// 发件人是否已阅
        /// </summary>
        public bool IsSViewed
        {
            get { return _issviewed; }
            set { _issviewed = value; }
        }

        /// <summary>
        /// 收件人是否已阅
        /// </summary>
        public bool IsRViewed
        {
            get { return _isrviewed; }
            set { _isrviewed = value; }
        }

        public int IsSDeleted
        {
            get { return _issdeleted; }
            set { _issdeleted = value; }
        }

        public int IsRDeleted
        {
            get { return _isrdeleted; }
            set { _isrdeleted = value; }
        }


    }
    
    
    
}
